package demo3;

public class Date {
    public int year;
    public int month;
    public int day;

    public void setData(int year,int month,int day){
        this.year=year;
        this.month=month;
        this.day=day;
    }
    public void printData(){
        System.out.println(this.year+"/"+this.month+"/"+this
        .day);
    }
    //构造方法
    public Date(){
        this(2007,4,2);
        System.out.println("调用无参构造方法");
    }
    public Date(int year,int month,int day){
        this.year=year;
        this.month=month;
        this.day=day;
        System.out.println("调用三个参数方法");
    }
}
